/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Clases;


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Gustavo
 */
public class CargaVoltaje {
    
    public ListaVoltaje Lectura()
    {
       ListaVoltaje lista=new ListaVoltaje();
       //String csvFile = "C:\\Users\\Gustavo\\Desktop\\STUARDO\\PROYECTO\\TesisProject\\Tablas\\Presion.csv";
	String csvFile= new File("").getAbsolutePath()+"\\Tablas\\Voltaje.csv";
        System.out.println(csvFile);
                BufferedReader br = null;
	String line = "";
	String cvsSplitBy = ",";
 
	try {
 
		br = new BufferedReader(new FileReader(csvFile));
		while ((line = br.readLine()) != null) {
 
		        // use comma as separator
			String[] item = line.split(cvsSplitBy);			
                        lista.Insertar(item[0]);
                        
		}
                lista.imprimir();
 
	} catch (FileNotFoundException e) {
		e.printStackTrace();
	} catch (IOException e) {
		e.printStackTrace();
	} finally {
		if (br != null) {
			try {
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
 
	System.out.println("Lista Leida completamente!");
        System.out.println("Encontro:"+lista.BuscarMaximo("4600"));
        
        return  lista;
  }


 
}
